package com.siashan.toolkit.captcha.easy;

import com.siashan.toolkit.captcha.cache.CaptchaCacheAutoConfiguration;
import com.siashan.toolkit.captcha.cache.CaptchaProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * 验证码缓存自动配置器
 *
 * @author siashan
 * @since v1.0.5
 */
@Configuration
@EnableConfigurationProperties(CaptchaProperties.class)
@Import(CaptchaCacheAutoConfiguration.class)
public class EasyCaptchaAutoConfiguration {



    @SuppressWarnings("rawtypes")
    @Bean
    @ConditionalOnMissingBean
    public EasyCaptchaTemplate easyCaptchaTemplate() {
        EasyCaptchaTemplate easyCaptchaTemplate = new EasyCaptchaTemplate();
        return easyCaptchaTemplate;
    }
}
